package org.csu.logistics.config;

import java.io.FileWriter;
import java.io.IOException;

public class AliPayConfig {

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String APP_ID = "2021000117687950";

    // 商户私钥，您的PKCS8格式RSA2私钥，这些就是我们刚才设置的
    public static String MERCHANT_PRIVATE_KEY = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCU4Vy85t3W82sGWRE1hoVgEkCRf99pyDlhZrlEV8QIUHLIQljzy6lH8lhPvqzTxOZ4ICyCd9XaJ2feWScIq5ovr2UmpQHxsDD9O4UAq6XBSwJepWa0Ld4DMEYQF2RQpbnc4Xs1lGRX0BLywFxXVq5wb3VmR5Kr3pbjxtS8GmyYDtlwEDiyBFX/OhHSLjDhyKLdf4K418fD02pChnrRDJbU4Vc+HXZAJjaqdJLRnP45LKOLsfReRImaB5230oTbZIqIlEblojpM2J6VCL3c7cMNBW/QffGynuM5tYHRIKmx5mMeCbdAp7a3tJAXuzONmC/IBPK4j78CK9QbcwmtIdZZAgMBAAECggEAMH+dezflylDva1j2Xy5cImivufYi7E26S31wGtBQXrj+OzhJy9lrYrGSjR+7Ix1ASp+IgFPTSUaO8oKuUYe9KY2EcOtNz9KqksOh1w8TZv0tX3GYHFfYu8cs+67zEcZ63nZhcZnOekCg+40oR5dIKf5VCyWDpRNUqgyqXkBpYbrsDZnvgLfDgA5Ul6w699DRzgTTxCqD/ud2RhU37P6jduXTcJRsBDup/IDPqTF13oI33LWHg4S8g9QLHBhVw93n5th6YP0QVbyBtxRWnXQxgBxwNr4jXgwReFw4kL1/ibI42k5ck5hy4hekTwbPoFz6F7W/MwUvKr1G2lBVPchbAQKBgQDiKmFKbsvToQCUq5vCCMIa/ClhslI4peNN7ayWptorODdoYlkwYjTyo6eIgQcFiIbmNm4mKS36rj4oHqHk8JamwTYrhEeBQUDLcpJonh130ZRFuLfYA2WSMynpbhscBIQJBLO9xQU1cNTUgU2hPLjKRco+IcAUHbgdMewiWQKJIQKBgQCohQ6SO/yidWrllPogCoQF7v+y9VjRZjQQCLBs9TN7aPE6h6+kEuxh93FRU5ssxKXOnP3SfNcmANlJ2lUwAD+a4yWKs3DXu6+GosFgpseTqtdKHoI3hC6pgOIWsMWWzN0r0ZDjgOwvZP1SfSAKZ9ctVW6g3ctiayTOKwVIvmGOOQKBgQDORVDOjhagQWtCLPG2Gj7OVcV4MScEO2gAnxCVpj+8w1zley1VD3yy/8fAm81HoqlGNcZoT45734cZGDcXksYT+IvrTI3auSTbaPdXKz49FYxhuoMSJKbynG9RUvauqv+xKfS004hYoTu7ROMEd1kiQlyeJjIFJsXQ+sMe4IeLgQKBgQCX9HriI9M3TrdYU1CDidfoXc0VuqQfFZCGkL89UJDejA9RHr6jLSkXYX89vSzkXmHAf9FkdouuSf+k14oPIXo5GO9mNU3gSe4JckL6+whlQBynSgFTPA6za3Ly0O0qgIpCk9KZQkw2pFLEie1VVLMzvqBlz/kwQrrKaQJ3yKvBCQKBgQCRK4NwLUAIp/bkiCYaZzNILmtxbUpWzMcn6Y+wZjm9m46lyScevcf/1YB0vExmXvfsTm5A4KnpBtraoRqTvwaA+7tJq/j6bm7IHUez6M/wJPntl+vQ26FvhPYAiWK0IpKg1njd0G4EPC/kqOdCrpDtW1K40ny5zEzzIpGF6fXXwg==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。，这些就是我们刚才设置的
    public static String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAn1JrS4HNL4pFiAt09gP/v7bwtd/lX9aoGCub/60q+z9sj64a+H/aJxL4jSASmrLQUxqxyXXMYI+GDn3BL5GUOTTYrD+y/YmRNvLbdPUDb5LZj0jOhiS2T0d9zNpNJtHe8qTODmOnkCkHItFx8v3qijpt3Bk4tCp30cymGym7ERm5gU3HsIcK5rJAcp7C1dEqNc2Q0N3WXCqdxrYOTeskiLUL5JGaHOMT2mDzoL/+wKv8vdWjn4xzH9YvO+QPOhgHyoQCCRAp9Hr8vqqib5K8Qb1gNwbCEKAGiIQ7LeVeHSymJyH0z+GJdoN9xnq6kz8Cu4t0xt1HzJnJdpvYqYe+3wIDAQAB";
    //异步通知，再这里我们设计自己的后台代码
    public static String notify_url = "http://xelrngod.dongtaiyuming.net/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://xelrngod.dongtaiyuming.net/return_url.jsp";

    // 签名方式
    public static String SIGN_TYPE = "RSA2";

    // 字符编码格式
    public static String CHARSET = "utf-8";

    // 支付宝网关
    public static String GATEWAYURL = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String LOG_PATH = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(LOG_PATH + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
